using UnityEngine;
using UnityEngine.UI;
using QFramework;
using UnityEngine.SceneManagement;
using QAssetBundle;

namespace ProjectSurvivor
{
    public class TestUIGameStartPanelData : UIPanelData
    {
    }
    public partial class TestUIGameStartPanel : UIPanel, IController
    {
        protected override void OnInit(IUIData uiData = null)
        {
            mData = uiData as TestUIGameStartPanelData ?? new TestUIGameStartPanelData();
            // please add init code
            Time.timeScale = 1.0f;
            BtnStartGame.onClick.AddListener(()=>
            {
                AudioKit.PlaySound(Sfx.BUTTONCLICK);
                Global.ReSet();
                this.CloseSelf();
                SceneManager.LoadScene("SampleScene");
            });
            BtnCoinUpgrade.onClick.AddListener(() =>
            {
                AudioKit.PlaySound(Sfx.BUTTONCLICK);
                CoinUpgradePanel.Show();
            });
            BtnAcheievement.onClick.AddListener(() =>
            {
                AudioKit.PlaySound(Sfx.BUTTONCLICK);
                AcheievementPanel.Show();
            });
            this.GetSystem<CoinUpgradeSystem>().Say();
        }

        protected override void OnOpen(IUIData uiData = null)
        {
        }

        protected override void OnShow()
        {
        }

        protected override void OnHide()
        {
        }

        protected override void OnClose()
        {
        }

        public IArchitecture GetArchitecture()
        {
            return Global.Interface;
        }
    }
}
